This repository was archived by the owner on Jul 18, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed
server/Character/Lobby/Selector Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using GTANetworkAPI ;
3
+ using Newtonsoft . Json ;
4
+
5
+ namespace Project . Server . Character . Lobby . Selector
6
+ {
7
+ public class Events : Script
8
+ {
9
+ [ RemoteEvent ( Shared . Events . LOBBY_SELECTOR_PLAY ) ]
10
+ public void OnPlay ( Client player , string data )
11
+ {
12
+ try
13
+ {
14
+ var payload = JsonConvert . DeserializeObject < Shared . Schemes . LobbySelectorPlay > ( data ) ;
15
+
16
+ var character = Character . Service . GetOwnCharacterByFullName ( player , payload . FirstName , payload . LastName ) ;
17
+
18
+ if ( character is Character . Entity )
19
+ {
20
+ Service . Play ( player , character ) ;
21
+ }
22
+ }
23
+ catch ( Exception e )
24
+ {
25
+ Console . WriteLine ( e ) ;
26
+ }
27
+ }
28
+ }
29
+ }
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using GTANetworkAPI ;
3
+
4
+ namespace Project . Server . Character . Lobby . Selector
5
+ {
6
+ public static class Service
7
+ {
8
+ public static void Play ( Client player , Character . Entity character )
9
+ {
10
+ var attachment = new Character . Attachment
11
+ {
12
+ Entity = character
13
+ } ;
14
+
15
+ Character . Service . SetAttachment ( player , attachment ) ;
16
+
17
+ // TODO continue logic
18
+ Console . WriteLine ( "Selector Service Play: im here" ) ;
19
+ }
20
+ }
21
+ }
You can’t perform that action at this time.
0 commit comments