![]() |
Clientside Classes
Having a bit of a problem. I'm having problems joining a class to a player when the log online.
Here's what I have so far, it just doesn't seem to interact with the player, at all. HTML Code:
//#CLIENTSIDE HTML Code:
//#CLIENTSIDE |
You can't, shouldn't, join classes on the Clientside, it needs to be done Serverside.
And if its done Serverside, I think the Clientside and Serverside player objects are not the same so It would only effect the serverside player. |
Quote:
So there isn't a way to use "player." clientside? |
Not that I know of :(
Set up global references on the clientside that lead to the object with the function. |
Thanks, I'll see what I can do!
|
You can always use attr's to access the information clientside and then send it over serverside when you're done to save or so.
|
Quote:
as for the doAction, you are calling player.drawMaps() and player.defaultStats(), since you are joining the class to the player, the player now becomes the object, so "this" will refer to the player. Since the player does not have those functions, they are not being called. In this case, it shouldn't have been joined to the player in the first place. Joining a class to a player clientside sure does work :) |
Quote:
|
Quote:
PHP Code:
PHP Code:
|
...
Why would joining classes even work clientside, isn't that a security issue? |
Quote:
|
Quote:
|
Quote:
And Graal is...well...not secure ^^ |
Quote:
|
Joining classes works on clientside, but with 4.20 the onCreated() thing is not necessary called when the script has not been loaded yet. In the next Graal version clientside classes work much better (I'm using it for customized gui controls and such stuff).
About security: client-side objects can join any class that have a clientside script. It shouldn't really be a problem because (1) you need to be able to write the script that calls "join", so you basicly need RC already, (2) in that case you could also easily call join on serverside, so you don't win anything, and (3) even if someone hacks the client and manages to join another class, he/she can only use scripts which are meant for clientside stuff anyway, (4) it might be possible to add a server option to restrict client-side joining to certain classes, although I don't see a case where that could be necessary |
| All times are GMT +2. The time now is 12:25 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.