Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Source Code] Create Nick Name

Newbie Spellweaver
Joined
Jun 21, 2015
Messages
69
Reaction score
15
CM_LOBBY_CREATE_NICK_NAME

Code:
[COLOR=#9F9F9F]namespace PBServer.network.clientpacket[/COLOR]
[COLOR=#9F9F9F]{[/COLOR]
[COLOR=#9F9F9F]using PBServer;[/COLOR]
[COLOR=#9F9F9F]using PBServer.data.model;[/COLOR]
[COLOR=#9F9F9F]using PBServer.data.xml.holders;[/COLOR]
[COLOR=#9F9F9F]using PBServer.model.players;[/COLOR]
[COLOR=#9F9F9F]using PBServer.network;[/COLOR]
[COLOR=#9F9F9F]using PBServer.network.serverpackets;[/COLOR]
[COLOR=#9F9F9F]using PBServer.src.data.xml.holders;[/COLOR]
[COLOR=#9F9F9F]using PBServer.src.managers;[/COLOR]
[COLOR=#9F9F9F]using PBServer.src.model.accounts;[/COLOR]
[COLOR=#9F9F9F]using System;[/COLOR]

[COLOR=#9F9F9F]internal class CM_LOBBY_CREATE_NICK_NAME : ReceiveBaseGamePacket[/COLOR]
[COLOR=#9F9F9F]{[/COLOR]
[COLOR=#9F9F9F]private string name;[/COLOR]
[COLOR=#9F9F9F]private byte name_lenght;[/COLOR]

[COLOR=#9F9F9F]public CM_LOBBY_CREATE_NICK_NAME(GameClient Client, byte[] data)[/COLOR]
[COLOR=#9F9F9F]{[/COLOR]
[COLOR=#9F9F9F]base.makeme(Client, data);[/COLOR]
[COLOR=#9F9F9F]}[/COLOR]

[COLOR=#9F9F9F]protected internal override void read()[/COLOR]
[COLOR=#9F9F9F]{[/COLOR]
[COLOR=#9F9F9F]base.readH();[/COLOR]
[COLOR=#9F9F9F]this.name_lenght = base.readC();[/COLOR]
[COLOR=#9F9F9F]this.name = base.readS(this.name_lenght - 1);[/COLOR]
[COLOR=#9F9F9F]}[/COLOR]

[COLOR=#9F9F9F]protected internal override void run()[/COLOR]
[COLOR=#9F9F9F]{[/COLOR]
[COLOR=#9F9F9F]GameClient client = base.getClient();[/COLOR]
[COLOR=#9F9F9F]PlayerTemplate template = PlayerTemplateHolder.getPlayerTemplate(Config.PlayerTemplateId);[/COLOR]
[COLOR=#9F9F9F]if (!AccountManager.getInstance().isPlayerNameExist(this.name))[/COLOR]
[COLOR=#9F9F9F]{[/COLOR]
[COLOR=#9F9F9F]AccountManager.getInstance().get(base.getClient().getPlayer().name).setRank(template._rank);[/COLOR]
[COLOR=#9F9F9F]AccountManager.getInstance().get(base.getClient().getPlayer().name).setExp(template._exp);[/COLOR]
[COLOR=#9F9F9F]AccountManager.getInstance().get(base.getClient().getPlayer().name).setGP(template._gp);[/COLOR]
[COLOR=#9F9F9F]AccountManager.getInstance().get(base.getClient().getPlayer().name).setPlayerName(this.name);[/COLOR]
[COLOR=#9F9F9F]PlayerInventory pi = new PlayerInventory(base.getClient().getPlayer().getPlayerId());[/COLOR]
[COLOR=#9F9F9F]Account p = AccountManager.getInstance().get(base.getClient().getPlayer().name);[/COLOR]
[COLOR=#9F9F9F]int num = AccountManager.getInstance().CreatePlayer(client.getPlayer().name, p);[/COLOR]
[COLOR=#9F9F9F]if (num >= 0)[/COLOR]
[COLOR=#9F9F9F]{[/COLOR]
[COLOR=#9F9F9F]for (int i = 0; i < template._startInventory.Count; i++)[/COLOR]
[COLOR=#9F9F9F]{[/COLOR]
[COLOR=#9F9F9F]ItemsModel item = new ItemsModel {[/COLOR]
[COLOR=#9F9F9F]id = template._startInventory[i].id,[/COLOR]
[COLOR=#9F9F9F]slot = template._startInventory[i].slot[/COLOR]
[COLOR=#9F9F9F]};[/COLOR]
[COLOR=#9F9F9F]pi.getItemsAll().Add(item);[/COLOR]
[COLOR=#9F9F9F]}[/COLOR]
[COLOR=#9F9F9F]p.setInventory(pi);[/COLOR]
[COLOR=#9F9F9F]base.getClient().setAccount(p.player_id);[/COLOR]
[COLOR=#9F9F9F]base.getClient().sendPacket(new SM_LOBBY_CREATE_NICKNAME(0L));[/COLOR]
[COLOR=#9F9F9F]ChannelInfoHolder.getChannel(base.getClient().getChannelId()).addPlayer(p);[/COLOR]
[COLOR=#9F9F9F]}[/COLOR]
[COLOR=#9F9F9F]else if (num == -1)[/COLOR]
[COLOR=#9F9F9F]{[/COLOR]
[COLOR=#9F9F9F]base.getClient().sendPacket(new SM_LOBBY_CREATE_NICKNAME(0x80000113L));[/COLOR]
[COLOR=#9F9F9F]}[/COLOR]
[COLOR=#9F9F9F]else[/COLOR]
[COLOR=#9F9F9F]{[/COLOR]
[COLOR=#9F9F9F]base.getClient().sendPacket(new SM_LOBBY_CREATE_NICKNAME(0x80000113L));[/COLOR]
[COLOR=#9F9F9F]}[/COLOR]
[COLOR=#9F9F9F]}[/COLOR]
[COLOR=#9F9F9F]else[/COLOR]
[COLOR=#9F9F9F]{[/COLOR]
[COLOR=#9F9F9F]base.getClient().sendPacket(new SM_LOBBY_CREATE_NICKNAME(0x80000113L));[/COLOR]
[COLOR=#9F9F9F]}[/COLOR]
[COLOR=#9F9F9F]}[/COLOR]
[COLOR=#9F9F9F]}[/COLOR]
[COLOR=#9F9F9F]}[/COLOR]


SM_LOBBY_CREATE_NICKNAME

Code:
[COLOR=#9F9F9F]namespace PBServer.network.serverpackets[/COLOR]
[COLOR=#9F9F9F]{[/COLOR]
[COLOR=#9F9F9F]using PBServer;[/COLOR]
[COLOR=#9F9F9F]using System;[/COLOR]

[COLOR=#9F9F9F]public class SM_LOBBY_CREATE_NICKNAME : SendBaseGamePacket[/COLOR]
[COLOR=#9F9F9F]{[/COLOR]
[COLOR=#9F9F9F]private long _status;[/COLOR]

[COLOR=#9F9F9F]public SM_LOBBY_CREATE_NICKNAME(long status)[/COLOR]
[COLOR=#9F9F9F]{[/COLOR]
[COLOR=#9F9F9F]base.makeme();[/COLOR]
[COLOR=#9F9F9F]this._status = status;[/COLOR]
[COLOR=#9F9F9F]}[/COLOR]

[COLOR=#9F9F9F]protected internal override void write()[/COLOR]
[COLOR=#9F9F9F]{[/COLOR]
[COLOR=#9F9F9F]base.writeH(0xc1e);[/COLOR]
[COLOR=#9F9F9F]base.writeQ(this._status);[/COLOR]
[COLOR=#9F9F9F]}[/COLOR]
[COLOR=#9F9F9F]}[/COLOR]
[COLOR=#9F9F9F]}[/COLOR]
 
Junior Spellweaver
Joined
Nov 16, 2013
Messages
138
Reaction score
13
Assist in the development of server ... Simple , noting that the codes are not mine :) found and shared here
this packet is in the every public point blank servers. there not found any special in here.
 
Newbie Spellweaver
Joined
Jun 21, 2015
Messages
69
Reaction score
15
this packet is in the every public point blank servers. there not found any special in here.

Man, I 'm just sharing functions and leaving more detailed , I will still post more, because I stopped messing on my server then I will start to drop my future server code
 
Newbie Spellweaver
Joined
Aug 4, 2006
Messages
81
Reaction score
0
sorry i have a question... how to use this code ? or how to appy to my server ?
 
Back
Top