#pragma once

#include "PG_ChannelBase.h"
#include "../../MainProc/NetGlobal.h"

class NetCli_Channel : public CNetGlobal
{
protected:
    //-------------------------------------------------------------------
    static NetCli_Channel* This;
    static bool _Init();
    static bool _Release();
    //-------------------------------------------------------------------

	static void _PG_ChannelBase_LtoC_CreateChannelResult		( int Sockid , int Size , void* Data );
	static void _PG_ChannelBase_LtoC_JoinChannelResult			( int Sockid , int Size , void* Data );
	static void _PG_ChannelBase_LtoC_LeaveChannelResult			( int Sockid , int Size , void* Data );
	static void _PG_ChannelBase_ChattoC_ClientConnectToChat		( int Sockid , int Size , void* Data );
	static void _PG_ChannelBase_ChattoC_DataTransmitCliToCli	( int Sockid , int Size , void* Data );

	static void _PG_ChannelBase_ChattoC_ChannelPlayerListResult	( int Sockid , int Size , void* Data );
	static void _PG_ChannelBase_ChattoC_JoinPlayerDisabledResult( int Sockid , int Size , void* Data );

	static void _PG_ChannelBase_ChattoC_SysChannel				( int Sockid , int Size , void* Data );

public:    
    NetCli_Channel() { This = this; }

	static void S_CreateChannel				( const char* ChannelName , const char* Password );
	static void S_JoinChannel				( const char* ChannelName , const char* Password );
	static void S_LeaveChannel				( GroupObjectTypeEnum Type , int ChannelID );
	static void S_DataTransmitToCli_Group	( GroupObjectTypeEnum Type , int ChannelID , const char* Data , int DataSize );
	static void S_DataTransmitToCli_Name	( char* Name , const char* Data , int DataSize );

	static void S_ChannelPlayerList		( GroupObjectTypeEnum Type , int ChannelID );
	static void S_JoinPlayerDisabled	( GroupObjectTypeEnum Type , int ChannelID , bool JoinEnabled );
	static void S_KickPlayer			( GroupObjectTypeEnum Type , int ChannelID , char* PlayerName );
	static void S_SetManager			( GroupObjectTypeEnum Type , int ChannelID , char* PlayerName );

	//區域頻道的ID
	static void S_ChannelZoneID			( int MapZoneID );


	virtual void R_CliConnectToChat( int ChatSockID ) = 0 ;
	//收到Cli 轉送給 Cli的資訊
	virtual void R_ClitoCli_Data( const char* Data , int Size ) = 0;

	virtual void R_CreateChannelOK(  int ChannelID , const char* Name ) = 0;
	virtual void R_CreateChannelFailed( const char* Name ) = 0;
	virtual void R_JoinChannelOK( int ChannelID , const char* Name ) = 0;
	virtual void R_JoinChannelFailed( const char* Name  ) = 0;
	virtual void R_LeaveChannelOK( int ChannelID ) = 0;
	virtual void R_LeaveChannelFailed( int ChannelID ) = 0;

	virtual void R_ChannelPlayerListResult	( GroupObjectTypeEnum Type , int ChannelID , vector<string> &Name ) = 0;
	virtual void R_JoinPlayerDisabledResult ( int ChannelID , GroupObjectTypeEnum Type , bool JoinEnabled ) = 0;

	//系統頻道列表
	virtual void R_SysChannel( GroupObjectTypeEnum Type , int ChannelID , char* Name ) = 0;

};

