public virtual Task <ServerPassportEnterGame> VerifyEnterGameAsync(ClientEnterServerRequest server, ClientEnterGameRequest req) { return(Task.FromResult(new ServerPassportEnterGame() { Verified = true })); }
public virtual bool ValidateGateToken(ClientEnterServerRequest enter) { if (enter.c2s_gate_token == current_token) { return(true); } return(false); }
protected virtual async Task <IRemoteService> CreateSessionServiceAsync(string socketID, ClientEnterServerRequest enter) { var cfg = new HashMap <string, string>(); cfg["sessionID"] = socketID; cfg["accountID"] = enter.c2s_account; cfg["connectName"] = this.SelfAddress.ServiceName; cfg["channel"] = enter.c2s_clientInfo.channel; cfg["passport"] = enter.c2s_clientInfo.sdkName; var addr = ServerNames.CreateSessionServiceAddress(enter.c2s_account, this.SelfAddress); var session = await this.Provider.GetOrCreateAsync(addr, cfg); if (session.Config["connectName"] != this.SelfAddress.ServiceName) { //如果Session在别的进程// this.log.WarnFormat("已存在相同Session在其他Connect:{0}", session.Address); this.log.WarnFormat("关闭老的Session:{0}", session.Address); var newAddress = ServerNames.CreateSessionServiceAddress(enter.c2s_account, this.SelfAddress); //log.Log(string.Format("Session Replace {0} -> {1}", session.Address, newAddress)); try { await session.ShutdownAsync("new connect"); } catch (Exception err) { log.Error(err.Message, err); } session = await this.Provider.CreateAsync(newAddress, cfg); //throw new Exception("Session Alread Exist In Node : " + ret.Address.ServiceNode); } return(session); }