Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32416
Modified Files:
inlines.h npc.cpp walking.cpp
Log Message:
Implemented a make ascii funciton that converts german umlauts into their 7bit representation for the ascii only packets (paperdoll, status)
Index: walking.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/walking.cpp,v
retrieving revision 1.156
retrieving revision 1.157
diff -C2 -d -r1.156 -r1.157
*** walking.cpp 14 Oct 2004 00:24:53 -0000 1.156
--- walking.cpp 26 Oct 2004 18:37:34 -0000 1.157
***************
*** 529,533 ****
// If the direction we're moving is already equal to our current direction
bool running = dir & 0x80;
! dir = dir & 0x7F; // Remove the running flag
pChar->setRunning(running);
--- 529,533 ----
// If the direction we're moving is already equal to our current direction
bool running = dir & 0x80;
! dir = dir & 0x7; // Remove all unneeded stuff
pChar->setRunning(running);
Index: inlines.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/inlines.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** inlines.h 24 Sep 2004 04:47:25 -0000 1.30
--- inlines.h 26 Oct 2004 18:37:34 -0000 1.31
***************
*** 77,79 ****
--- 77,120 ----
}
+ inline QString makeAscii(const QString &input) {
+ QString result;
+
+ for (int i = 0; i < input.length(); ++i) {
+ QChar c = input.at(i);
+
+ // German umlauts can be represented differently
+ switch (c) {
+ case 'ü':
+ result.append("ue");
+ continue;
+ case 'ä':
+ result.append("ae");
+ continue;
+ case 'ö':
+ result.append("oe");
+ continue;
+ case 'ß':
+ result.append("ss");
+ continue;
+ case 'Ü':
+ result.append("Ue");
+ continue;
+ case 'Ä':
+ result.append("Ae");
+ continue;
+ case 'Ö':
+ result.append("Oe");
+ continue;
+ }
+
+ // Other non representable char
+ if (c.latin1() < 1 || (c.latin1() > 122 && c.latin1() != 127)) {
+ continue;
+ }
+ result.append(c);
+ }
+
+ return result;
+ }
+
#endif
Index: npc.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v
retrieving revision 1.123
retrieving revision 1.124
diff -C2 -d -r1.123 -r1.124
*** npc.cpp 15 Oct 2004 14:38:22 -0000 1.123
--- npc.cpp 26 Oct 2004 18:37:34 -0000 1.124
***************
*** 239,242 ****
--- 239,243 ----
{
owner_->removePet( this, true );
+
}
|