Aller au contenu
Top-Metin2.org - Vous êtes à la recherche d'un serveur Metin 2 ? ×
×
×
  • Créer...

Afficher le nombre de joueurs connecté


Messages recommandés

Centre de Téléchargement

Hidden Content

    Give reaction to this post to see the hidden content.
( Interne )

spacer.png

 

Révélation

spacer.png

 

spacer.png

 

Révélation

 

Sources :

Révélation

Sources Client :

Révélation

Local_inc.h

Ajoutez :







#define __CHANNEL_STATUS_UPDATE__

 

Packet.h

Cherchez :







typedef struct SChannelStatus
{
	...
}

Et remplacez par :







typedef struct SChannelStatus
{
	short nPort;
	BYTE bStatus;
#if defined(__CHANNEL_STATUS_UPDATE__)
	int player_count;
#endif
} TChannelStatus;

 

PythonApplicationModule.cpp

Recherchez :







#ifdef ENABLE_COSTUME_SYSTEM
	PyModule_AddIntConstant(poModule, "ENABLE_COSTUME_SYSTEM",	1);
#else
	PyModule_AddIntConstant(poModule, "ENABLE_COSTUME_SYSTEM",	0);
#endif

Et ajoutez en dessous :







#if defined(__CHANNEL_STATUS_UPDATE__)
	PyModule_AddIntConstant(poModule, "__CHANNEL_STATUS_UPDATE__", true);
#else
	PyModule_AddIntConstant(poModule, "__CHANNEL_STATUS_UPDATE__", false);
#endif

 

ServerStateChecker.cpp

Cherchez dans le fichier :







				PyCallClassMemberFunc(m_poWnd, "NotifyChannelState", Py_BuildValue("(ii)", it->uServerIndex, channelStatus.bStatus));

Et remplacez le par :







#if defined(__CHANNEL_STATUS_UPDATE__)
				PyCallClassMemberFunc(m_poWnd, "NotifyChannelState", Py_BuildValue("(iii)", it->uServerIndex, channelStatus.bStatus, channelStatus.player_count));
#else
				PyCallClassMemberFunc(m_poWnd, "NotifyChannelState", Py_BuildValue("(ii)", it->uServerIndex, channelStatus.bStatus));
#endif

 

Sources Serveur :

common

Révélation

service.h / CommonDefines.h

Ajoutez :







#define __CHANNEL_STATUS_UPDATE__

 

tables.h

Cherchez :







typedef struct SChannelStatus
{
	...
}

Et remplacez par :







typedef struct SChannelStatus
{
	short nPort;
	BYTE bStatus;
#if defined(__CHANNEL_STATUS_UPDATE__)
	int player_count;
#endif
} TChannelStatus;

 

 

db/src/

Révélation

ClientManager.cpp

Cherchez :







void CClientManager::UpdateChannelStatus(TChannelStatus* pData)
{
	...
	...
}

void CClientManager::RequestChannelStatus(CPeer* peer, DWORD dwHandle)
{
	...
	...
}

Et remplacez par :







void CClientManager::UpdateChannelStatus(TChannelStatus* pData)
{
	TChannelStatusMap::iterator it = m_mChannelStatus.find(pData->nPort);
#if defined(__CHANNEL_STATUS_UPDATE__)
	if (it != m_mChannelStatus.end()) {
		it->second.first = pData->bStatus;
		it->second.second = pData->player_count;
	}
	else
		m_mChannelStatus.emplace(pData->nPort, std::make_pair(pData->bStatus, pData->player_count));
#else
	if (it != m_mChannelStatus.end()) {
		it->second = pData->bStatus;
	}
	else {
		m_mChannelStatus.insert(TChannelStatusMap::value_type(pData->nPort, pData->bStatus));
	}
#endif
}

void CClientManager::RequestChannelStatus(CPeer* peer, DWORD dwHandle)
{
	const int nSize = m_mChannelStatus.size();
	peer->EncodeHeader(HEADER_DG_RESPOND_CHANNELSTATUS, dwHandle, sizeof(TChannelStatus)*nSize+sizeof(int));
	peer->Encode(&nSize, sizeof(int));
#if defined(__CHANNEL_STATUS_UPDATE__)
	for (const auto& v : m_mChannelStatus) {
		peer->Encode(&v.first, sizeof(decltype(v.first)));
		peer->Encode(&v.second.first, sizeof(decltype(v.second.first)));
		peer->Encode(&v.second.second, sizeof(decltype(v.second.second)));
	}
#else
	for (TChannelStatusMap::iterator it = m_mChannelStatus.begin(); it != m_mChannelStatus.end(); it++) {
		peer->Encode(&it->first, sizeof(short));
		peer->Encode(&it->second, sizeof(BYTE));
	}
#endif
}

 

ClientManager.h

Cherchez :







	typedef boost::unordered_map<short, BYTE> TChannelStatusMap;

Et changez en :







#if defined(__CHANNEL_STATUS_UPDATE__)
	typedef boost::unordered_map<short, std::pair<BYTE, int>> TChannelStatusMap;
#else
	typedef boost::unordered_map<short, BYTE> TChannelStatusMap;
#endif

 

 

/game/src/

Révélation

desc_client.cpp

Cherchez







		channelStatus.nPort = mother_port;

Et ajoutez :







#if defined(__CHANNEL_STATUS_UPDATE__)
		channelStatus.player_count = iTotal;
#endif

 

 

Client/pack/root/

Révélation

intrologin.py

Recherchez :





			self.channelList.InsertItem(channelID, " %s %s" % (channelName, channelState))

Et changez avec :





			if app.__CHANNEL_STATUS_UPDATE__:
				self.channelList.InsertItem(channelID, " %s %s     |cffADFF2F%d" % (channelName, channelState, channelDataDict["count"]))
			else:
				self.channelList.InsertItem(channelID, " %s %s" % (channelName, channelState))

Cherchez :





	def NotifyChannelState(self, addrKey, state):
		...
		...

Et remplacez par :





	if app.__CHANNEL_STATUS_UPDATE__:
		def NotifyChannelState(self, addrKey, state, player_count):
			try:
				stateName=serverInfo.STATE_DICT[state]
			except:
				stateName=serverInfo.STATE_NONE

			regionID=self.__GetRegionID()
			serverID=self.__GetServerID()
			channelID=addrKey%10

			try:
				serverInfo.REGION_DICT[regionID][serverID]["channel"][channelID]["state"] = stateName
				serverInfo.REGION_DICT[regionID][serverID]["channel"][channelID]["count"] = player_count
				self.__RefreshServerStateList()

			except:
				import exception
				exception.Abort(localeInfo.CHANNEL_NOT_FIND_INFO)

	else:
		def NotifyChannelState(self, addrKey, state):
			try:
				stateName=serverInfo.STATE_DICT[state]
			except:
				stateName=serverInfo.STATE_NONE

			regionID=self.__GetRegionID()
			serverID=self.__GetServerID()
			channelID=addrKey%10

			try:
				serverInfo.REGION_DICT[regionID][serverID]["channel"][channelID]["state"] = stateName
				self.__RefreshServerStateList()

			except:
				import exception
				exception.Abort(localeInfo.CHANNEL_NOT_FIND_INFO)

 

serverinfo.py

Modifiez votre "CHANNEL_DICT" :





'state':STATE_NONE,

Ajoutez :





'state':STATE_NONE,'count':0,

 

Exemple :





SERVER1_CHANNEL_DICT = {
	1:{"key":11,"name":"CH1","ip":SRV1["host"],"tcp_port":SRV1["ch1"],"udp_port":SRV1["ch1"],"state":STATE_NONE,"count":0,},
	2:{"key":12,"name":"CH2","ip":SRV1["host"],"tcp_port":SRV1["ch2"],"udp_port":SRV1["ch2"],"state":STATE_NONE,"count":0,},
	3:{"key":13,"name":"CH3","ip":SRV1["host"],"tcp_port":SRV1["ch3"],"udp_port":SRV1["ch3"],"state":STATE_NONE,"count":0,},
	4:{"key":14,"name":"CH4","ip":SRV1["host"],"tcp_port":SRV1["ch4"],"udp_port":SRV1["ch4"],"state":STATE_NONE,"count":0,},
	5:{"key":15,"name":"CH5","ip":SRV1["host"],"tcp_port":SRV1["ch5"],"udp_port":SRV1["ch5"],"state":STATE_NONE,"count":0,},

 

 

 

Sources :

Hidden Content

    Give reaction to this post to see the hidden content.

  • Metin2 Dev 3
  • Good 2
Lien vers le commentaire
Partager sur d’autres sites

  • Réponses 0
  • Créé
  • Dernière réponse

Meilleurs contributeurs dans ce sujet

Jours populaires



  • brilliantdiscord_widget
  • Flux d'Activité

    1. 21

      Metin2 en 2020 peut-on en parler?

    2. 0

      METIN2Project

    3. 3

      Ressources - UnPack - Metin2 Client - Officiel

    4. 0

      Barre des tâches d'argent étendue

    5. 16

      Redémarrage automatique des channels

    6. 16

      Multi Logo GM / SGM / GA

    7. 0

      comment extraire les fichiers locale.epk locale.eix sur le serveur officiel ?

    8. 2

      Funky-emu.net -> fr.metin2.dev

  • En ligne récemment

    • Aucun utilisateur enregistré regarde cette page.

Information importante

Conditions d’utilisation / Politique de confidentialité / Règles / Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.