* (hopefully) fixed several bugs related to number rounding and wrong math calculations. thx to crogge for the report.

* deleted old files
This commit is contained in:
False.Genesis 2007-04-02 01:07:28 +00:00
parent 520ee863a6
commit 7961aa9046
5 changed files with 27 additions and 552 deletions

View File

@ -1,237 +0,0 @@
/////////////////////////////////////////////////////////////
// PseuWoW changelog // date|time: 20:31 11.12.2006 /////////
/////////////////////////////////////////////////////////////
//Format:
// + added
// - note
// % removed
// ! important
// O ToDo: open, not yet done
// x Todo: done
/////////////////////////////////////////////////////////////
ToDo (Overall):
================
- simulation of no installed addons
- more config possibilities in conf/pseuwow.conf
- redo controller related code and recode controller
- character creation - to be able to create chars with names bl!zz does not allow
- remove hardcoded language names, use lang names via config
-> string table? not sure.
- ppoints system? as a workaround for maps? not sure.
- much much more i cant think of yet :P
#Far future:
- kind of an AI that it can decide for itself what to do
- add ability to use blizz/mangos maps so that it can really walk around, not only teleport
- to be continued...
- looting, 2D/3D GUI, killing,... you can extend the list as you wish
ToDo (version after: Alpha 13) / Planned Features:
==================================================
O add a ZCompressor Class (a ByteBuffer using zlib deflate/inflate)
O [maybe] first touch with the UpdateFields (CMSG[_COMPRESSED]_UPDATE_OBJECT)
O [maybe] add Object/Unit/Player/Creature/... classes.
X cleanups to VarSet class (use vectors to store the vars)
O cleanups to DefScript class: use vectors to store the script text data
O DefScript: instead of only ${var} also be able to use $var like in TCL or PHP
O Implement threaded movement system. tracking of player's waypoints, better following code
(that does NOT tend to crash mangos!)
O improve chat AI? add other AI? not sure.
O logfile output
[...]
ToDo (next version: Alpha 12) / Planned features:
=================================================
X lots of general code cleanups (remove old C functions from PseuWoW Alpha 7 and before;
add objects: PseuInstance, RealmSession, WorldSession, ...; drop the old procedurel code)
X opcode handler table, no more case x case y case z
O move code portions of the chat handler to an external ChatAI.cpp file and improve
the chat AI
O -> implement a WordList class to parse sentences
O a direct local console (like mangos has). drop plans about a remote controller for now.
O lots of bugfixes to the DefScript system
X implement zthread, zlib and remove the SDL thread functions.
X change the network system from SDL_net to the system by Anders Hedstrom (the one mangos uses). no more packet errors (i hope)!
O DefScript: implement a "PermissionMap" to set by the user (for internal funcions)
O config options: EnableIngameCommands, EnableLocalConsole, OverrideLoginGuid (dangerous!),
AutoReconnect,
O DefScript fuctions: "GetGuid,var playername", "GetName,var GUID"
X add WorldPacket class
X -> add uint64 WorldPacket::GetPackedGUID()
X fix the packed GUID code if needed (not sure if its really bugged)
O When everything is done: upload to openSVN!
20:43 09.11.2006 Alpha Build 11
=====================================
+ inluded modified WAD's TrayWoWemu.exe to work with PseuWoW -> TrayPseuWoW.exe =)
Core:
! connecting to servers running versions above 1.10.2 is now possible!
+ implemented player name cache, first touch with std::vector<> :)
-> players get added to the cache as soon as they move or say something
-> chat messages now show player names, whispers can be sent now.
-> related command: [-]savecache.
+ commands can now given directly ingame saying/whispering "-command" to PseuWoW
+ added DefScript functions _onwhisper (gets triggered when a player whispers to PseuWoW),
emote #id. the emote function still needs to be fixed and linked with targeting once
implemented.
+ included reply.def, that uses the above macros and whisper.def. use: reply to last whisp
in its original language
% removed some old obsoelete cpp files
% removed the old config reader, replaced with dynamic reader using the classes
VarSet, std::string, DefScript.
+ added CMSG_PING and SMSG_PONG (ping every 30 sec, like original WoW)
+ better detection if PseuWoW entered the world successfully
+ added macros: @thiswhisper,@lastwhisper,@thiscmd,@lastcmd,@thismsg,@lastmsg and related.
+ following a player: simply repeat movement opcodes recieved from that player.
looks very shitty and is very buggy xD
-> command/usage: [-]follow PlayerName to start, just [-]follow to stop.
+ you can access all values set in PseuWoW.conf as CAPITALIZED variables, e.g.:
"${REALMLIST}" or ingame "-sayv REALMLIST".
+ once the conf is loaded the script "_setconf" is executed, this removes dangerous vars
like ACCNAME and ACCPASS
+ auto-decline of group-invite and trade attempts
!+ added support for packed GUIDs
+ added def files: outv, sayv, _nopermission, _setconf
DefScript engine:
- renewed variable handler (renaming *local* var to scriptname::var, #var to var,
@var stays @var)
- fixed lots of bugs in the ReplaceVars() function.
- fixed a little bug in the script loader (wrongly loaded lines beginning with '#')
+ added a permission system for scripts called by players. use users.conf to set.
(like that its not possible for non-GMs to execute "-say .shutdown" or similar)
17:23 06.10.2006 Alpha Build 10
===================================
+ FULLY working script engine with C++ interface, only very few functions implemented yet.
Dynamic loading: Scripts get only loaded if they are needed.
+ preparations to stop using C malloc/realloc/free and replace it with NEW,
also std::string instead of char*
+ PseuWoW can recieve whisper/say/party/guild/server messages, but not yet link them
to a name.
+ improved packet error/order handling, there are still some packets that get lost,
i need to find out where they go. SDL thread issue?
% removed yelling PseuWoW version on startup. Use the ./scripts/_worldenter.def script
file to modify behaviour when entering the world.
- PseuWoW can now detect if it has sent a chatmessage itself or if it came from someone else
- added a little fun code and a VERY "basic" chat AI for fun :P
- it will say a note if it is sure it has entered the world correctly. it might have been
successful anyway even without it, but at least you can be sure when it will probably work.
requires "SAY ${@version}" in scripts/_enterworld.def
18:15 10.09.2006 Alpha Build 9
===============================
+ Added CircularBuffer class for world packet reciever
+ Added SDLTCPConnection class for easier connectivity and code readability
- first preparations for builtin script engine, still excluded from build,
needs cleanups and fixes.
-> coded the variable handler
-> coded the script loader
-> coded the script line tokenizer
+ Added connection to world server
+ World Authentication done
% removed old rs_... / ws_... functions, replaced with SDLTCPConnection realmCon/worldCon
% disabled the controller interface for now. it will be included again as soon as the
script interpreter works and everything has been cleaned up.
+ Integrated AuthCrypt class from mangos
+ CHAR_ENUM integrated, char list is now requested and parsed
+ read charname from conf file and login with that char
YES, logging into the world finally WORKS! :DD
+ some checks for invalid or strange packets, which are tried to be interpreted correctly.
packet ordering and fetch queue is still buggy.
- PseuWoW yells its version once it has joined the world, and yells if an error occured.
- only server messages get interpreted correctly so far, player chat recieve does NOT work
03:12 29.07.2006 Alpha Build 8
===============================
- completely rewrote the authentication code, Imported Sha1Hash and BigNumber
classes from MaNGOS (shrunk code size to 1/4 of what it was before).
The code even seems bug-free (hope it stays so)
- Authentication WORKS! (after 2 months of failure)
+ added realmlist parser
+ set realm to login via conf file
- Tested on WoWemu (1.8.0) & MaNGOS (1.10.2), authenticating works well
+ added a neat icon :) by ©haos
14:45 12.07.2006 Alpha Build 7
===============================
- complete code reorganisation (no more code including only with .h files.
now we have several cpp files with each its own .h)
- emulation of any version
- updated comment parser, finally :)
- you can now set version, build and language via conf file
- merged the 2 controller tcpsocks into 1, controller can still only connect to localhost.
still no conf file reading implemented into the controller. rest will be implemented later.
- removed SS & server b, they were useless
- fixed crash where an attemt was made to delete a const string.
(seems this caused the GarbageStack:: realloc() size=112 failure)
- many other general improvemens and bugfixes
02:31 10.06.2006 Alpha Build 6 - Memory handling is hard.
===============================
- fixed crash when realmlist hostname could not be resolved
! forgot to malloc x_str & u_str in proof packet sender -> crash (maybe i got it fixed this time)
- made more funcions work with the garbage collector
- in debug build GarbageStack:: realloc() size=112 fails. dunno why.
- added a server S & server b for testing. they are not important and will get removed later.
- still no correct reversion.
18:12 05.06.2006 Alpha Build 5 - The I hate C++ version
===============================
- crash,crash,crash. there must be a bug in the BN_reverse routine.
+ Added a garbage collector
- updated the fileparser, because it got bugged with the garbage collector.
More configs are supported now. comments still must be at the beginning of the line
to be treated as comments.
- still working on correct reversal :C
22:55 31.05.2006 Alpha Build 4 - The DAMN FUCKING SHIT i don't get it version
===============================
- damn i just don't find it out. decided to do a random reversal on every failure.
- the program got very unstable. seems i do a mistake i am not aware of. help anyone?
-> added a debug output to find out where the bugged lines are. strage they change
everytime i run the program. fuck.
18:16 31.05.2006 Alpha Build 3 - The YAAAY it works version
==============================
- finished the packet, server still answers "password wrong".
working on correct reversion now
16:52 30.05.2006 Alpha Build 2
===============================
- added more bignum calculations, now i got until S.
- still not sure how they have to be reversed to be calculated corrctly in the B1!77 way.
SRP demo page (srp.stanford.edu/demo) says my S is correct so far, calculated in the
normal way. At least i got the right formulas. :D
- next thing to do is split S up, hash it, etc... to get M1 & M2
21:51 24.05.2006 Alpha Build 1
===============================
- first release, not working yet.
- connecting to realm server possible, detection for acc already in use / acc not existing
- OpenSSL BIGNUM and SHA1 integrated.
- first bignum calculations :), i still have to find out how the numbers are
reversed and calculated correctly
- controller connection possible. it uses 2 ports, i will change it to 1 port in future
- config file readout (conf/pseuwow.conf)
- still crashes when it cant find the realmlist. time to fix it...
- controller connection is still buggy when a connection to the realm server has been
established.

View File

@ -1,308 +0,0 @@
####################################################################################
################################# - PseuWoW ReadMe - ########## 09.11.2006 #########
####################################################################################
## ##
## Web: http://my.opera.com/PseuWoW ##
## Email/MSN: hoden386@lycos.de ##
## ##
## 1.) What is PseuWoW? ##
## 2.) Installation & configuration ##
## 3.) The DefScript engine [to be updated] ##
## 4.) The controller [*availible soon*] ##
## 5.) Interaction with PseuWoW ##
## 6.) Compiling your own version ##
## 7.) A word to Blizzard ##
## ... ##
## 8.) Appendix: [*availible soon*] ##
## A) The DefScript interface ##
## B) Macro reference ##
## C) Function reference ##
## ##
## ##
####################################################################################
####################################################################################
####################################################
########## 1.) What is PseuWoW? ####################
####################################################
A custom wow client, or at least it is supposed to be a "real" client later on.
For now it is thougt to be a bot that can help GMs/admins to manage their *private(!)* WoW server.
It does not need an installation of real WoW to run, and you do not need any
good hardware to run it, since it has no graphics (yet!) and not such extensive
memory usage like the bloated WoW.exe has.
it uses only the console for now, but since it runs on SDL, you *could* easily build up
your own gui using OpenGL. buts it's not designed for that purpose in this early state.
DO NOT use this program to connect to official servers!
It does NOT work due to Blizzard's IP-Spoof filter, which PseuWoW cant bypass yet.
( YES this IS intended to be that way! For your own safety and for the legality of PseuWoW!)
If you should try anyway, the only thing you can win is the ban/loss of your account.
Performance:
============
Tested Build 8 on a 300MHz Intel Celeron notebook, took a bit longer to Auth then on a
3GHz Pentium 4 PC, but worked well so far; more benchmarks on slower hardware will follow =)
####################################################
########## 2.) Installation & Configuration ########
####################################################
Required DLL files:
===================
- SDL.dll
- SDL_net.dll
- msvcp71(d).dll
- msvcr71(d).dll
Be sure you have them put into the same folder as PseuWoW.exe (or your windows/system32 folder).
How to make it run properly (main configuration):
=================================================
Open the file "conf/PseuWoW.conf" in a text editor and edit it to your needs.
There should be comments inside the file explaining what the options are good for.
User permission configuration:
==============================
Open the file "conf/users.conf".
For every player you want to assign a permission level to enter the name of the player (note correct spelling!!),
followed by a "=" and the permission level ( a number from 0 - 255; 0=least; 255=all permissions ).
The lines should look like this:
Master=255
Operator=100
Playerx=1
...
If a player is not listed in this file he will get permission 0 automatically.
Note that special unicode chars in playernames like óäöüßêýà etc. DO NOT work.
Saving the cache:
=================
If you close PseuWoW using the [X] in the top-right corner it will be instantly closed
and NO data will be saved. To save the data you can either quit PseuWoW pressing Ctrl+C,
giving the "-quit" command ingame or just save without quitting giving the ingame command
"-savecache". (explained further down this file)
####################################################
########## 3.) The DefScript engine ################
####################################################
Information:
============
PseuWoW uses a scripting language exclusively designed for it - i admit i didn't know
how to implement Python or LUA :P
DefScript has no controlling structures like IF, FOR, WHILE, etc. yet, this will come in future.
The Scripts have the extension ".def" and are stored in the "/scripts/" folder of PseuWoW.
Every file represents a single function.
Syntax:
=======
A typical function call looks like this:
command,arg1,arg2,arg3,argx defaultarg
command: name of the script or function you want to execute (UPPER- or lowercase does not matter)
arg1 - argx: OPTIONAL(!) arguments, seperated by commas.
defaultarg: the last ( or better called "typical" ) argument of the function,
seperated by [space].
Everything after the first space char will be treated as defaultarg!
To prevent this, you can use curly brackets {} to express that the given text is connected.
e.g.:
"SENDCHATMESSAGE,6,{hi there},Keks" -> correct, works. Whispers "hi there" to player "Keks".
"SENDCHATMESSAGE,6,hi there,Keks"
-> works too, BUT:
"SENDCHATMESSAGE,6,hi" -> this will be the command with its args
"there,Keks" -> this will be the defaultarg
result: the call will not produce the expected result!
Variables:
==========
Setting variables:
"x = 1" -> WRONG! DefScript knows only functions!!
You have tu use this:
"SET,x 1" -> sets the LOCAL variable x to 1. [x will be stored as "scriptname::x" internally]
"SET,#x 1" -> sets the GLOBAL variable x to 1. [#x will be stored as "x" internally]
"SET,#welcomemsg PseuWoW logged on, be careful!" -> sets the GLOBAL variable "welcomemsg" to PseuWoW logged on, be careful!".
Note that the variable name is the first arg, preceded with a comma, and its value is the defaultarg.
Variable names with a preceding "#" will be stored as GLOBAL vars, with the preceding "#" removed.
"DEFAULT,x 1" -> sets x only if it has not been set or x has no value (=is empty)
"UNSET x" -> removes the variable. you have to remove every variable you do no longer need yourself!
A special kind of variables are macros, which values can only be changed by the program itself.
Macros begin with "@".
Accessing variables:
====================
SET,x 1
SET,mystr hello world
OUT ${mystr}, x has the value ${x}
PAUSE 1000
SET,mystr ${mystr} goodbye
OUT ${mystr}
pretty obvious:
${mystr} gets replaced with "hello world"
${x} gets replaced with 1.
and the text "hello world, x has the value 1" will be written to the console.
after one second, mystr will be set to "hello world goodbye" and again written to console.
accessing globals: OUT ${#myglobal}
accessing macros: OUT ${mymacro}
[[* more explanations of the variable system will follow *]]
Load Instructions:
==================
load instructions begin with "#" and are put at the beginning of every script.
You can not use variables in them!
The following are availible:
#permission=x -> sets the permission required to execute this script. 0 by default! x=0...255
#debug -> produce more output
#load_debug -> lists every line that is loaded
#load_notify -> notifies you once the script has been loaded and is ready for use
...more to come...
####################################################
########## 5.) Interaction with PseuWoW ############
####################################################
You can either say or whisper the command to PseuWoW; put a "-" before the command name
that PseuWoW recognizes the chat message as a command, like:
"-say hello"
"-say,orcish hello"
"-say,8 hello"
"-emote 12"
"-yell LOL"
"-yell,darnassian LOL"
"-savecache"
"-follow Keks"
"-quit"
etc.
There is also some VERY basic chat AI, say hi,lol,omg,wtf,download,... when PseuWoW will hear you and it will respond :)
A full (and useful) chat AI will be implemented later.
All trade and party invite rquests are automatically declined.
Note the "_onwhisper" script that is run everytime a whisper is recieved.
####################################################
########## 6.) Compiling your own version ##########
####################################################
- i used Microsoft Visual Studio.NET 2003 for compiling
- download the include/lib package (see URL on top). copy the content into the
include/lib directory of the compiler.
- if needed, copy the reqired DLL files into the /bin directory (where the project files are)
- open the project and compile.
####################################################
########## 7.) A word to Blizzard ##################
####################################################
I always liked blizz... until WoW came out.
The management is shitty, almost no customer support, and bans in case they dont know what
to do with players.
Blizzard programmers and designers, YOU ARE GREAT and you made great games before
Blizzard got eaten up by vivendi universal. KEEP UP THE GOOD WORK!
After that, vivendi management fucked it all up. the result is WoW, a always-pay game like
Diablo3 will probably be.
So here are my greetings to the vivendi management:
Eat shit and die, bitches!
_gm__gz,
,Z\/` 'c\.
/,! '[W
]!] . []
] ] .-==- b]
]i ~ -==== !]-
] ~~ -![
W d`
'b W
i[ 'M
]. ~ 4.
] -'[
d -= b
M! @
@ `-D
]@ -]A
@P , , . '@
M| ~` '` /]@
_._. Y ciP
,g/G/~Vi ![ '-V[
,Z~_/`- b@_ ,[ -` [
_v4Tv/ .m/TGs,2V~-i ] \/.[
,vf ,(f `'iY.A / -[,z --=-__
,gY` v)` \-.@! ,--]Wf =/`,~N
,gY` id / b@[ -/ ]M (b.
vf| - t[ !,i@P! ' ][. /`YZ~V,c.
if, ' , ,(] ]'@` ]b `'/@. `'*W.
K ,)`-'Z _ _ -/i@ i ' @Y |4t /Vmv.
b gz/-Z`'` @ - ] -P] ` , i ,!W ]@ ',/M.-
[ gZ\ ]! * i[ ! Z!d, ]- [W ~ \ ] X8.\
,[ '7v` A 'i ` - !' ] [@./ , ,] 4/c-
] !i- `][ ,] ' e!] i - . m ! 'W =
W s-=` ][ !A /- ] W= ][!
A -Z- @- -! P ,A, , ] ,@
[ '- ,/4. !' Z` [ . W g`/[
Y.- ' /[ . ,/ !.'c/b-
Vi'- ' ! ! / ' `` @[
'e. ] , . v @[
Vs. '. .- ` / @`
'5c. \ ! , --@.
\Zs `-. '- \ - -A
'\. - . ' ' - ` .-, = 'i[
'e. -' - , -` ,/ !vi\ v i*`
Vs -! -- ' v` ,'.-'/ _/`\`
'G. ' ! '- / '.c\,` vfm/ -
!i ` -. ,` ` , `'c ,z7!.` -
Yi ' - ! . ,`` - - !` ,zL'`
b i , - - ' - , - - ,Z|!`
Y ` \- , , '- ` , . ,Z7
8 -- . ` -` .'.- -P
] ] -, . - , ,[
]. Y- ' / 8
i| ,' - ` . - ' W
` , - - , , K
(c) SnowStorm Software, 2006
(and the finger belogs to SSG cracking group :P )

View File

@ -6,6 +6,7 @@
#include <string.h> #include <string.h>
#include <algorithm> #include <algorithm>
#include <cctype> #include <cctype>
#include <math.h>
#include "DefScriptDefines.h" #include "DefScriptDefines.h"
#include "DefScriptTools.h" #include "DefScriptTools.h"
@ -25,8 +26,15 @@ std::string DefScriptTools::stringToUpper(std::string s)
std::string DefScriptTools::toString(ldbl num) std::string DefScriptTools::toString(ldbl num)
{ {
std::stringstream ss; std::stringstream ss;
ss << num; ss.setf(std::ios_base::fixed);
return ss.str(); ss.precision(15);
ss << Round(num,15);
std::string s(ss.str());
while(s[s.length()-1]=='0')
s.erase(s.length()-1,1);
if(s[s.length()-1]=='.')
s.erase(s.length()-1,1);
return s;
} }
std::string DefScriptTools::toString(uint64 num) std::string DefScriptTools::toString(uint64 num)
@ -72,16 +80,19 @@ ldbl DefScriptTools::toNumber(std::string str)
u<<=32; u<<=32;
u|=lobits; u|=lobits;
} }
else else
u = atoi64(str.c_str()); u = atoi64(str.c_str());
if(ppos!=std::string::npos) if(ppos!=std::string::npos)
{ {
std::string mantissa("0."); std::string mantissa("0");
mantissa+=str.c_str()+ppos; mantissa+=str.c_str()+ppos;
num=(ldbl)strtod(mantissa.c_str(),NULL); num=(ldbl)atof(mantissa.c_str());
} }
num=(unsigned long double)num + u; num=(unsigned long double)num + u;
num=Round(num,10);
if(negative) if(negative)
num = -num; num = -num;
@ -140,3 +151,9 @@ uint64 DefScriptTools::atoi64(const char *str)
//return _atoi64(str); //return _atoi64(str);
#endif #endif
} }
inline long double DefScriptTools::Round(long double z,unsigned int n)
{
static long double v[] = { 1, 10, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16 };
return floor(z * v[n] + 0.5) / v[n];
}

View File

@ -11,6 +11,7 @@ namespace DefScriptTools
bool isTrue(std::string); bool isTrue(std::string);
uint64 toUint64(std::string); uint64 toUint64(std::string);
uint64 atoi64(const char*); uint64 atoi64(const char*);
inline long double Round(long double z,unsigned int n);
} }

View File

@ -26,6 +26,7 @@
Optimization="3" Optimization="3"
GlobalOptimizations="TRUE" GlobalOptimizations="TRUE"
InlineFunctionExpansion="2" InlineFunctionExpansion="2"
ImproveFloatingPointConsistency="FALSE"
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="shared;Client;Client/World;Client/Realm;dep/include" AdditionalIncludeDirectories="shared;Client;Client/World;Client/Realm;dep/include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
@ -93,6 +94,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
ImproveFloatingPointConsistency="FALSE"
OptimizeForProcessor="0" OptimizeForProcessor="0"
AdditionalIncludeDirectories="shared;Client;Client/World;Client/Realm;dep/include" AdditionalIncludeDirectories="shared;Client;Client/World;Client/Realm;dep/include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"