// bool get_ok(nNWM.nBaseball.NetEventPlugin_baseball plugin, nProtoBS.s_ans_answer_restart_game rd) { /* * int idx = 0; * foreach (var db_id in rd.uid) * { * if (db_id == plugin.db_id()) * { * break; * } ++idx; * } * if (idx == 0) * { * plugin.LogWarning("s_ans_answer_restart_game db_id==0"); * return false; * } * * int idx2 = 0; * foreach (var ok in rd.ok) * { * if (idx2 == idx) * { * return ok; * break; * } ++idx2; * } * plugin.LogWarning("s_ans_answer_restart_game idx2 error"); * return false; * */ return(rd.ok[0] == true && rd.ok[1] == true); }
public void login(nNWM.nConsole.jConsoleArg arg) { const int eIP_PORT = 0, eUID = 1; if (IsFail_ArgCheck(arg, "<ip:port> <uid>")) { return; } string[] ip_port = arg[eIP_PORT].Split(':'); if (ip_port.Length != 2) { m_CMD.LogWarning(arg[eIP_PORT] + " is invaild format"); return; } user_id_t uid = user_id_t.Parse(arg[eUID]); var plugin = m_MSG.Find(uid); if (plugin == null) { plugin = new nNWM.nBaseball.NetEventPlugin_baseball(user_id_t.Parse(arg[eUID]), m_CMD, m_MSG); m_MSG.Login(ip_port[0], System.Int32.Parse(ip_port[1]), plugin); return; } else { if (plugin.m_MSGClient != null) { m_CMD.LogWarning(" client socket(MSGClient) is exist. "); plugin.m_MSGClient.Connect(ip_port[0], System.Int32.Parse(ip_port[1])); return; } plugin.NetLog("[INFO]exist user plugin connect"); m_MSG.Login(ip_port[0], System.Int32.Parse(ip_port[1]), plugin); } }