public override void Deserialize(MemoryStream ms) { this.stream = ms; var tag = 0; while (reader.BaseStream.Position < reader.BaseStream.Length && (tag = reader.ReadInt32()) != 0) { switch (tag) { case 1: { username = reader.ReadString(); break; } case 2: { password = reader.ReadString(); break; } case 3: { ePartnerID = (EPartnerID)reader.ReadInt32(); break; } } } }
public static void OnLogin(string username, string password, EPartnerID ePartnerID) { var req = new PktLoginRequest(); req.username = username; req.password = password; req.ePartnerID = (int)ePartnerID; AClientApp.RemoteCall <PktLoginResult>(req, OnLoginCb); }
public AAvatarServer OnCreateAvatar(EPartnerID ePartnerID, string uid, string avatarName, int sex, Player player) { var oid = ObjectId.GenerateNewId(); var inst = ADBManager.Get(InitValueDefs.dbconnect, InitValueDefs.dbname).UpdateOneData(ParamNameDefs.TableAvatar , ADBAccessor.filter_eq(ParamNameDefs.UID, uid) & ADBAccessor.filter_eq(ParamNameDefs.PartnerID, (int)ePartnerID) & ADBAccessor.filter_eq(ParamNameDefs.AvatarName, avatarName) , ADBAccessor.updates_build(ADBAccessor.update(ParamNameDefs.AvatarSex, sex), ADBAccessor.update(ParamNameDefs.CollectionID, oid)), true); var a = new AAvatarServer(uid, null, oid, player); OnAddAvatar(a, player); return(a); }
public override void rcvLoginCb(bool bSuccess, string uid, EPartnerID ePartnerID) { if (bSuccess) { AClientApis.OnEnterGame(); } UEventListener.Instance.OnDispatchEvent(UEvents.Login, new EventLogin() { bSuccess = bSuccess }); }
internal void Create(string unionid, EPartnerID ePartnerID, string avatarName, int sex) { SetValue(ParamNameDefs.UnionID, unionid); SetValue(ParamNameDefs.PartnerID, (int)ePartnerID); SetValue(ParamNameDefs.AvatarName, avatarName); SetValue(ParamNameDefs.AvatarSex, sex); SetValue(ParamNameDefs.AvatarLevel, 1); SCommonds.AddItem("create", id, InitValueDefs.gold, 10000); SCommonds.AddItem("create", id, InitValueDefs.money, 10); }
internal override void rcvLoginCb(bool bSuccess, string uid, EPartnerID ePartnerID) { if (bSuccess) { AClientApis.OnEnterGame(); } else { UEventListener.Instance.OnDispatchEvent(UEvents.LoginFailed, new EventLoginFailed()); } AOutput.Log($"rcvLoginCb {bSuccess}, {uid}"); }
public void OnAddPlayer(string uid, EPartnerID ePartnerID, IResponer client) { if (dConnectionIndexedPlayers.ContainsKey(client.playerConnDesc)) { dConnectionIndexedPlayers[client.playerConnDesc].client.Response(new PktServerMessage() { message = "duplicatelogin" }); if (dConnectionIndexedPlayers[client.playerConnDesc].avatar != null) { dConnectionIndexedPlayers[client.playerConnDesc].avatar.OnDispose(); } dConnectionIndexedPlayers.Remove(client.playerConnDesc); } dConnectionIndexedPlayers.Add(client.playerConnDesc, new Player(uid, ePartnerID, client)); }
public void OnAddPlayer(string uid, EPartnerID ePartnerID, IResponer client) { if (dUIDIndexedPlayers.ContainsKey(uid)) { dUIDIndexedPlayers[uid].client.Response(new PktServerMessage() { message = "duplicatelogin" }); dUIDIndexedPlayers[uid].OnDisconnect(); dUIDIndexedPlayers.Remove(uid); } if (dConnectionIndexedPlayers.ContainsKey(client.playerConnDesc)) { dConnectionIndexedPlayers[client.playerConnDesc].OnDisconnect(); dConnectionIndexedPlayers.Remove(client.playerConnDesc); } var p = new Player(uid, ePartnerID, client); dConnectionIndexedPlayers.Add(client.playerConnDesc, p); dUIDIndexedPlayers.Add(uid, p); }
public Player(string uid, EPartnerID ePartnerID, IResponer client) { this.client = client; this.uid = uid; this.ePartnerID = ePartnerID; }
internal virtual void rcvLoginCb(bool bSuccess, string uid, EPartnerID ePartnerID) { AOutput.Log($"NotImplemented rcvLoginCb"); }
public override void rcvLoginCb(bool bSuccess, string uid, EPartnerID ePartnerID) { AOutput.Log($"rcvLoginCb {bSuccess}, {uid}, {ePartnerID}"); }
public virtual void rcvLoginCb(bool bSuccess, string uid, EPartnerID ePartnerID) { AOutput.Log($"NotImplemented rcvLoginCb {bSuccess} {uid} {ePartnerID}"); }