Hi innspiral,
Try this way
1. Create a CS file use the code below
- public class MyChatSystem : CuteChat.AppSystem
- {
- protected override CuteChat.ChatPortal CreatePortalInstance(string name)
- {
- return new MyChatPortal(name);
- }
- }
- public class MyChatPortal : CuteChat.AppPortal
- {
- public MyChatPortal(string name)
- : base(name)
- {
- }
- public override CuteChat.ChatChannel CreateChannel(string name)
- {
- CuteChat.ChatChannel channel = base.CreateChannel(name);
- CuteChat.AppLobbyChannel lc = channel as CuteChat.AppLobbyChannel;
- if (lc != null)
- {
- return new MyLobbyChannel(this, name, lc.Lobby);
- }
- return base.CreateChannel(name);
- }
- }
- public class MyLobbyChannel : CuteChat.AppLobbyChannel
- {
- public MyLobbyChannel(MyChatPortal portal, string name, CuteChat.AppLobby lobby)
- : base(portal, name, lobby)
- {
- }
-
- public override bool PreProcessCTSMessage(CuteChat.ChatConnection conn, string msgid, string[] args, System.Collections.Specialized.NameValueCollection nvc)
- {
- if (conn.Identity.IsAnonymous)
- {
- this.Manager.PushSTCMessage(conn, ChatMetaData.ServerMsg_SYS_ERROR_MESSAGE, null, "You can't do anything because you have not signed up.");
- }
-
- return base.PreProcessCTSMessage(conn, msgid, args, nvc);
- }
- }
2. Change the chat provider start section to
CuteChat.ChatProvider.Instance=new SamplePortal.Components.SampleProvider();
CuteChat.ChatSystem.Start(new MyChatSystem());
//MyChatSystem() is the class definition by above code
Regards,
ken