File tree 2 files changed +4
-3
lines changed
LoginServer/ServerPackets
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -66,8 +66,8 @@ class CharacterCreate {
66
66
}
67
67
68
68
async checkMaxNumberCharacters ( login ) {
69
- const characters = await database . getCharactersByLogin ( login ) ;
70
69
const MAXIMUM_NUMBER_OF_CHARACTERS = 7 ;
70
+ const characters = await database . getCharactersByLogin ( login ) ;
71
71
72
72
if ( characters . length >= MAXIMUM_NUMBER_OF_CHARACTERS ) {
73
73
return true ;
@@ -77,6 +77,7 @@ class CharacterCreate {
77
77
}
78
78
79
79
async _init ( ) {
80
+ const MAXIMUM_LENGTH_CHARACTER_NAME = 16 ;
80
81
const player = players . getPlayerByClient ( this . _client ) ;
81
82
82
83
if ( await this . checkMaxNumberCharacters ( player . login ) ) {
@@ -93,7 +94,7 @@ class CharacterCreate {
93
94
return ;
94
95
}
95
96
96
- if ( this . characterName . length >= 16 || ! this . _checkCharacterNameLetters ( this . name ) ) {
97
+ if ( this . characterName . length >= MAXIMUM_LENGTH_CHARACTER_NAME || ! this . _checkCharacterNameLetters ( this . name ) ) {
97
98
this . _client . sendPacket ( new serverPackets . CharacterCreateFail ( serverPackets . CharacterCreateFail . reason . REASON_16_ENG_CHARS ) )
98
99
99
100
return ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ const ServerPacket = require('./ServerPacket.js');
2
2
3
3
class ServerList {
4
4
constructor ( gameservers , playersOnline ) {
5
- this . _packet = new ServerPacket ( 1 + 3 + ( gameservers . length * ( 16 + 4 ) ) ) ; // fix size
5
+ this . _packet = new ServerPacket ( 1 + 3 + ( gameservers . length * ( 20 ) ) ) ;
6
6
this . _packet . writeC ( 0x04 )
7
7
. writeC ( gameservers . length )
8
8
. writeC ( 0x00 ) ; // Last server. 0 for normal sorting
You can’t perform that action at this time.
0 commit comments