Register for your free account! | Forgot your password?

You last visited: Today at 08:40

  • Please register to post and access all features, it's quick, easy and FREE!

 

[Mini] Strings an alle Clients senden

Reply
 
Old   #1
 
elite*gold: 30
Join Date: Jul 2010
Posts: 1,627
Received Thanks: 1,439
[Mini] Strings an alle Clients senden

moin, hab mir gedacht ich veröffentliche auch mal was...
Nichts weltbewegendes aber nützlich..

questlua_game.cpp:
Code:
	int game_cmd_all_users_string(lua_State* L)
	{
		const DESC_MANAGER::DESC_SET & c_ref_set = DESC_MANAGER::instance().GetClientSet();
		if (!lua_isstring(L, 1))
		{
			sys_err("CMD_ALL_USERS_S : wrong argument");
			return 0;
		}
		sys_log(0, "CMD_ALL_USERS_S -> String: %s", lua_tostring(L, 1));
			for (itertype(c_ref_set) it = c_ref_set.begin(); it != c_ref_set.end(); ++it)
			{
				LPCHARACTER ch = (*it)->GetCharacter();
				if (!ch)
					continue;
				ch->ChatPacket(CHAT_TYPE_COMMAND, "%s", lua_tostring(L, 1));
			}
		return 0;
	}
unten:

Code:
{ "CMD_ALL_USERS_S",			game_cmd_all_users_string		},
in einer Quest einfach:

Code:
local StringLenTest = "client_app "..app.." "..value1.." "..value2.." "..value3.." "..value4.." "..value5.." "..value6.." "..value7.." "..value8.." "..value9.." "..value10.." "..value11.." "..value12.." "..value13.." "..value14.." "..value15.." "..value16.." "..value17.." "..value18.." "..value19.." "..value20.." "..value21.." "..value22.." "..value23.." "..value24.." "..value25.." "..value26.." "..value27.." "..value28.." "..value29.." "..value30.." "..value31.." "..value32.." "..value33.." "..value34.." "..value35.." "..value36.." "..value37.." "..value38.." "..value39.." "..value40..""
		if (is_test_server())	then
			t_chat("LIB_client_app_Multi  StringLänge:"..string.len(StringLenTest).." | Funktion:"..app.."")
		end
		game.CMD_ALL_USERS_S(StringLenTest)
Habe es für mehre zwecke verwendet..

serverside müsst ihr einfach nur das CMD abfangen..

bei den Commands:

Code:
"client_app"			: self._clientapp,
unten:
Code:
	#ClientApp From Server
	def _clientapp(self,app,value1,value2,value3,value4,value5,value6,value7,value8,value9,value10,value11,value12,value13,value14,value15,value16,value17,value18,value19,value20,value21,value22,value23,value24,value25,value26,value27,value28,value29,value30,value31,value32,value33,value34,value35,value36,value37,value38,value39,value40):
		import _MyModificationsScripts
		import os
		import chat
		func_modul = str(app)
		if uiPython_api.is_testserver_ > 0:
			chat.AppendChat(chat.CHAT_TYPE_DEBUG, "_clientapp -> " + str(func_modul) )
			#value1,value2,value3,value4,value5,value6,value7,value8,value9,value10,value11,value12,value13,value14
			attrtype0,attrvalue0,attrtype1,attrvalue1,attrtype2,attrvalue2,attrtype3,attrvalue3 = value15,value16,value17,value18,value19,value20,value21,value22
			attrtype4,attrvalue4,attrtype5,attrvalue5,attrtype6,attrvalue6 = value23,value24,value25,value26,value27,value28
			socket0,socket1,socket2 = value29,value30,value31
		################################################
		##	PopupMessage
		#
		if func_modul == "popup_message":
			texte = str(value1.replace("*"," "))
			self.PopupMessage(texte)

	#//New Client Commands BETA!
	def BINARY_NewClientCommands(self,sz_String0,sz_String1,sz_String2,sz_String3):
		pass
		# For Lua!
		# logbase2 = get_locale_base_path()
		# logbase = string.gsub(logbase2,"germany", "")
		# local file = "NewClientCommandsValue"
		# local data = io.open(logbase..'/'..file,'w')
		# local data = io.open(logbase..'/'..file,'a+')
		# for i = 1, 40, 1 do
			# data:write("#"..i.."\n")
			# data:write("try:\n")
			# data:write("	value"..i.." = GetString["..i.."]\n")
			# data:write("except:\n")
			# data:write("	value"..i.." = 0\n")
		# end
		# data:close()
		#chat.AppendChat(1,"BINARY_NewClientCommands sz_String0:"  + str(sz_String0))
		#chat.AppendChat(1,"BINARY_NewClientCommands sz_String1:"  + str(sz_String1))
		#chat.AppendChat(1,"BINARY_NewClientCommands sz_String2:"  + str(sz_String2))
		#chat.AppendChat(1,"BINARY_NewClientCommands sz_String3:"  + str(sz_String3))
sieht alles bissel komisch aus, wollte es auch umändern aber es hat bestens geklappt. Das mit dem Popup message nur eine tolle idee...

Best Regards,
Risan


EDIT:
Fragt nicht wieso ich es nicht am ende splitten lies ka... Wahr wohl irgendwie drann gescheitet oder es kamm mir nicht in den sinn.. Weiss es nimmer...



.Risan. is offline  
Thanks
3 Users
Old   #2
 
elite*gold: 0
Join Date: Mar 2018
Posts: 44
Received Thanks: 8
Hi,

dies funktioniert dann soweit nur auf einem Core.
Um wirklich alle Clients zu erreichen muss man noch die anderen Cores über P2P / DB (Master) informieren damit die das dann auch an alle Clients senden.

Freundliche Grüsse
Ex0dia


Ex0dia is offline  
Thanks
1 User
Old   #3
 
elite*gold: 30
Join Date: Jul 2010
Posts: 1,627
Received Thanks: 1,439
Oh. Das habe ich noch nicht bedacht. Werde es irgendwann testen.. Theoretisch hast recht.
Danke für den Hinweis
.Risan. is offline  
Reply



« Previous Thread | Next Thread »

Similar Threads
[Guide] Dumping Clients, Importing RDB data to SQL, Updating RDBs (incl. strings)
Hi EPVP! I want to share my knowledge about RDB editing. Like my last post, I'm sharing this because I wish it was laid out as plainly in a post...
10 Replies - Rappelz Private Server
controlsend, wenn $i = 5, soll F5 senden bei $i = 3, soll F3 senden usw., geht das?
hi, also hab eine Variable $i und würd wenn $i = 1, gern controlsend("Programmname","","","{F1}") machen und wenn $i = 4, dann ...
2 Replies - AutoIt
[WTB] unded mini ghostly/mini panada/mini polar bear
Hi, Would like to buy one of those pets. Make me an offer if you got one. Thanks.
2 Replies - Guild Wars Trading



All times are GMT +2. The time now is 08:40.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.