private void IPlayerInfo() { pnAuth2Cli_AcctPlayerInfo notify = new pnAuth2Cli_AcctPlayerInfo(); notify.Read(fStream); // I realize that this message has a TransID // However, our current design doesn't play well with sending out // Multiple callbacks for one TransID. Therefore, player infos will // be a separate event [for now?] if (PlayerInfo != null) PlayerInfo(notify.fPlayerID, notify.fPlayerName, notify.fModel); }
private void IOnAcctLoggedIn(ENetError result, Guid guid, int perms, pnVaultAvatarInfo[] avatars, object param) { if (result == ENetError.kNetSuccess) { fAcctGuid = guid; fPermissions = (pnAcctPerms)perms; } List<plNetStruct> toSend = new List<plNetStruct>(6); if (avatars != null) { foreach (pnVaultAvatarInfo info in avatars) { pnAuth2Cli_AcctPlayerInfo player = new pnAuth2Cli_AcctPlayerInfo(); player.fExplorer = 1; // HACK--always a "paying customer" player.fModel = info.fModel; player.fPlayerID = info.fPlayerID; player.fPlayerName = info.fPlayerName; player.fTransID = (uint)param; toSend.Add(player); } } pnAuth2Cli_AcctLoginReply reply = new pnAuth2Cli_AcctLoginReply(); reply.fAcctGuid = guid; reply.fBillingType = 1; // HACK--always a "paying customer" reply.fDroidKey = null; // FIXME reply.fResult = result; reply.fTransID = Convert.ToUInt32(param); toSend.Add(reply); // Only acquire this lock once :) lock (fStream) foreach (plNetStruct ns in toSend) ns.Send(fStream); }