Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mycard
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
syntax_j
mycard
Commits
f5d31080
Commit
f5d31080
authored
Nov 28, 2011
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nbx初步,大厅广播
parent
d5574ce4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
lib/nbx.rb
lib/nbx.rb
+1
-1
lib/nbx_event.rb
lib/nbx_event.rb
+7
-1
No files found.
lib/nbx.rb
View file @
f5d31080
...
@@ -24,7 +24,7 @@ class NBX < Iduel
...
@@ -24,7 +24,7 @@ class NBX < Iduel
@conn_hall
.
send
(
"
#{
head
}
|
#{
args
.
join
(
','
)
}
"
,
0
,
user
?
user
.
host
:
'<broadcast>'
,
Port
)
@conn_hall
.
send
(
"
#{
head
}
|
#{
args
.
join
(
','
)
}
"
,
0
,
user
?
user
.
host
:
'<broadcast>'
,
Port
)
end
end
def
login
(
username
)
def
login
(
username
)
send
(
nil
,
'USERONLINE'
,
username
)
send
(
nil
,
'USERONLINE'
,
username
,
1
)
@user
=
User
.
new
(
username
,
'localhost'
)
@user
=
User
.
new
(
username
,
'localhost'
)
end
end
def
connect
(
server
,
port
=
Port
)
def
connect
(
server
,
port
=
Port
)
...
...
lib/nbx_event.rb
View file @
f5d31080
...
@@ -13,12 +13,18 @@ class NBX::Event
...
@@ -13,12 +13,18 @@ class NBX::Event
case
$1
case
$1
when
"USERONLINE"
when
"USERONLINE"
NBX
::
Event
::
USERONLINE
NBX
::
Event
::
USERONLINE
when
"Query"
end
.
new
(
$2
,
host
)
end
.
new
(
$2
,
host
)
end
end
end
end
class
NBX
::
Event
::
USERONLINE
<
NBX
::
Event
class
NBX
::
Event
::
USERONLINE
<
NBX
::
Event
attr_reader
:user
#, :session
attr_reader
:user
#, :session
def
initialize
(
info
,
host
)
def
initialize
(
info
,
host
)
@user
=
NBX
::
User
.
new
(
info
,
host
)
username
,
need_reply
=
info
.
split
(
','
)
@user
=
NBX
::
User
.
new
(
username
,
host
)
@need_reply
=
need_reply
==
"1"
p
info
,
need_reply
,
@need_reply
,
@need_reply
and
@user
!=
$nbx
.
user
$nbx
.
send
(
@user
,
'USERONLINE'
,
$nbx
.
user
.
name
)
if
@need_reply
and
@user
!=
$nbx
.
user
end
end
end
end
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment