protected override void OnPlayerLogin(SimpleNetManager.Player player) { foreach (var item in infoDatas) { Send2Client(player, item); } }
private void SendLog(SimpleNetManager.Player player, LogData data) { LogData2Client msg = new LogData2Client(); msg.logData = data; netManager.Send(player.session, msg); }
protected override void OnPlayerLoginAfter(SimpleNetManager.Player player) { List <LogData> list = new List <LogData>(logDatas); foreach (var data in list) { SendLog(player, data); } }
private static void Send2Client(SimpleNetManager.Player player, ShowInfoData data) { if (NetServer.NetManager != null) { AppInfoData2Client msg = new AppInfoData2Client(); msg.data = data; NetServer.NetManager.Send(player.session, msg); } }
protected override void OnPlayerLogin(SimpleNetManager.Player player) { foreach (var mData in invokeMothodsInfos) { List <MethodInfo> methods = mData.Value; foreach (MethodInfo m in methods) { RemoteInvokingAttribute attribute = GetCustomAttribute <RemoteInvokingAttribute>(m); MethodData2Client msg = new MethodData2Client(); msg.data.methodType = attribute.methodType; msg.data.showName = attribute.name; msg.data.description = attribute.description; msg.data.classFullName = mData.Key.FullName; msg.data.methodName = m.Name; ParameterInfo[] parameters = m.GetParameters(); IEnumerable <ParamsDescriptionAttribute> paramsDescriptions = GetCustomAttributes <ParamsDescriptionAttribute>(m); for (int i = 0; i < parameters.Length; i++) { ParameterInfo p = parameters[i]; ParamsData paramsData = new ParamsData(); ParamsDescriptionAttribute paramsDescription = ParamsDescriptionAttribute.GetParamsDescription(paramsDescriptions, p.Name);; if (paramsDescription != null) { paramsData.descriptionName = paramsDescription.paramsDescriptionName; } paramsData.paraName = p.Name; paramsData.paraTypeFullName = p.ParameterType.FullName; try { paramsData.defaultValueStr = GetDefaultValueString(mData.Key, p.ParameterType, paramsDescription); } catch (Exception e) { Debug.LogError(mData.Key.FullName + "." + m.Name + "\n" + e); } paramsData.selectItemValues = GetTypeSelectItemValues(p.ParameterType, paramsDescription); msg.data.paramsDatas.Add(paramsData); } //Debug.Log("Send MethodData2Client:" + JsonUtility.ToJson(msg)); netManager.Send(player.session, msg); } } }
public override uint LoginLogic(Login2Server msg, Session session, out SimpleNetManager.Player player) { URCSettingData config = URCSettingData.GetCofig(); string key = msg.key; string pw = msg.password; if (config.loginKey.Equals(key) && config.loginPassword.Equals(pw)) { player = new SimpleNetManager.Player(session); player.playerID = Guid.NewGuid().ToString(); return(0); } player = null; return(102); }
private void OnPlayerLoginEvent(SimpleNetManager.Player player) { SendSwitchState2Client(player.session); OnPlayerLogin(player); }
private void OnPlayerLoginAfterEvent(SimpleNetManager.Player player) { OnPlayerLoginAfter(player); }
protected virtual void OnPlayerLoginAfter(SimpleNetManager.Player player) { }